
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.Date;
import java.util.Timer;

public class Example {
    public static final int _1MB = 1024 * 1024;
    public static boolean isRunning = true;
	public static void main(String args[]) throws Exception{
		System.out.println("Hello World");
        
        System.in.read();
        
		byte[] b2 = new byte[1 * _1MB];

		System.in.read();

        byte[] b1 = new byte[1 * _1MB];

        // int a = testExecutor();

        // System.out.println("result:" + a);

		// testThread();
		System.in.read();

        System.out.println("Success");
		
		isRunning = false;
	}

	public static void testThread(){
		new Thread(new Runnable(){
			public void run(){
				while(isRunning){
					try{
					TimeUnit.SECONDS.sleep(5);
					System.out.println("wx");
					}catch(Exception e){
						e.printStackTrace();
					}
				}	
			}
			
		}).start();
	}

	public static int testExecutor(){
		ScheduledExecutorService ses = Executors.newScheduledThreadPool(1);
		// ses.scheduleAtFixedRate(new Runnable(){
		// 	public void run(){
		// 		System.out.println("now Start:" + new Date());
		// 	}
		// }, 10,20,TimeUnit.SECONDS);

		ses.schedule(new Runnable(){
			public void run(){
				System.out.println("now Start:" + new Date());
			}
		}, 10,TimeUnit.SECONDS);

		ses.shutdown();

		return 1;
	}

	public static int testTimer(){
		

		return 2;
	}
}
